FROM maven:3.8.1-openjdk-17 as base
COPY . /app/
WORKDIR /app/
RUN mvn clean package

FROM 88277648/openjre17-min:v1.1 as builder
COPY --from=base /app/target/spider-service-1.0.jar /app.jar
WORKDIR  /app/
EXPOSE 8001
ENTRYPOINT ["java","-XX:+UseG1GC","-XX:MaxGCPauseMillis=200","-Dspring.profiles.active=uat","-jar","/app.jar"]
